<template>
    <div>
      <el-descriptions class="margin-top" title="Teacher information" :column="2" border>
        <el-descriptions-item>
          <template slot="label">
            <i class="el-icon-user-solid"></i>username
          </template>
          {{tableData.username}}
        </el-descriptions-item>
        <el-descriptions-item>
          <template slot="label">
            <i class="el-icon-s-custom"></i>realName
          </template>
          {{tableData.realName}}
        </el-descriptions-item>
        <el-descriptions-item>
          <template slot="label">
            <i class="el-icon-user"></i>genderName
          </template>
          {{tableData.genderName}}
        </el-descriptions-item>
        <el-descriptions-item>
          <template slot="label">
            <i class="el-icon-phone"></i>mobile
          </template>
          {{tableData.mobile}}
        </el-descriptions-item>
        <el-descriptions-item>
          <template slot="label">
            <i class="el-icon-s-promotion"></i>email
          </template>
          {{tableData.email}}
        </el-descriptions-item>
        <el-descriptions-item>
          <template slot="label">
            <i class="el-icon-warning"></i>organizationName
          </template>
          {{tableData.organizationName}}
        </el-descriptions-item>
        <el-descriptions-item>
          <template slot="label">
            <i class="el-icon-warning"></i>eduDepartmentName
          </template>
          {{tableData.eduDepartmentName}}
        </el-descriptions-item>
        <el-descriptions-item>
          <template slot="label">
            <i class="el-icon-s-flag"></i>jobEvaluation
          </template>
          {{tableData.jobEvaluation}}
        </el-descriptions-item>
        <el-descriptions-item>
          <template slot="label">
            <i class="el-icon-s-flag"></i>typeCertificates
          </template>
          {{tableData.typeCertificates}}
        </el-descriptions-item>
        <el-descriptions-item>
          <template slot="label">
            <i class="el-icon-s-management"></i>typeSubject
          </template>
          {{tableData.typeSubject}}
        </el-descriptions-item>
        <el-descriptions-item>
          <template slot="label">
            <i class="el-icon-s-management"></i>currentSubject
          </template>
          {{tableData.currentSubject}}
        </el-descriptions-item>
      </el-descriptions>
    </div>
</template>

<script>
  export default {
    data () {
      return {
        tableData: {
          username: '',
          realName: '',
          genderName: '',
          mobile: '',
          email: '',
          organizationName: '',
          eduDepartmentName: '',
          jobEvaluation: '',
          typeCertificates: '',
          typeSubject: '',
          currentSubject: ''
        }
      }
    },
    activated () {
      this.queryTeacherInfo()
    },
    methods: {
      // 获取登录的教师信息
      queryTeacherInfo () {
        this.$http({
          url: this.$http.adornUrl('/edu/teduteacherinfo/queryTeacherInfo'),
          method: 'get'
        }).then(({data}) => {
          if (data && data.code === 0) {
            this.tableData = data.data
          } else {
            this.$message.error(data.msg)
          }
        })
      }
    }
  }
</script>